<template>
  <div class="search-container">
    <div @touchend="goSearch" class="search-content">
      <van-icon size="23px" color="#999" name="search" />
      <div class="content-text">请输入需要搜索的商品</div>
    </div>
    <div class="goods-tab">
      <div class="tab-content">
        <div
          ref="select"
          :class="{ select: $route.name === 'GoodsList' }"
          @touchend="changePage('GoodsList')"
        >
          商品
        </div>
        <div
          :class="{ select: $route.name === 'GoodsCollect' }"
          @touchend="changePage('GoodsCollect')"
        >
          收藏
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    goSearch() {
      this.$router.push("/search");
    },
    changePage(name) {
      this.$emit("changePage", name);
    },
  },
};
</script>

<style lang="scss" scoped>
@import "../css/SearchPart.scss";
</style>
